
import { Component } from 'react';

export default class Primitive extends Component {
    componentDidMount(){
        console.log( this );
        this.refs.btn.addEventListener( 'click' , this.handler , false );
    }
    handler = evt =>{
        evt.stopPropagation();
        console.log( 'Primitive: ' , this , evt );
    }
    componentWillUnmount(){
        this.refs.btn.removeEventListener( 'click' );
    }
    render(){
        return (<button onChange={this.handler} ref="btn">点我试试</button>);
    }
}